using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using Hardcodet.Wpf.TaskbarNotification.Interop;
using ns0;
using ns1;

namespace Hardcodet.Wpf.TaskbarNotification
{
	/// <summary>
	/// A WPF proxy to for a taskbar icon (NotifyIcon) that sits in the system's
	/// taskbar notification area ("system tray").
	/// </summary>
	/// <summary>
	/// Contains declarations of WPF dependency properties
	/// and events.
	/// </summary>
	public class TaskbarIcon : FrameworkElement, IDisposable
	{
		[CompilerGenerated]
		private sealed class Class1
		{
			public UIElement uielement_0;

			public PopupAnimation popupAnimation_0;

			public int? nullable_0;

			public TaskbarIcon taskbarIcon_0;

			internal void method_0()
			{
				taskbarIcon_0.ShowCustomBalloon(uielement_0, popupAnimation_0, nullable_0);
			}
		}

		[CompilerGenerated]
		private sealed class Class2
		{
			public Hardcodet.Wpf.TaskbarNotification.Interop.Point point_0;

			public TaskbarIcon taskbarIcon_0;

			internal void method_0()
			{
				taskbarIcon_0.LeftClickCommand.smethod_7(taskbarIcon_0.LeftClickCommandParameter, taskbarIcon_0.LeftClickCommandTarget ?? taskbarIcon_0);
				taskbarIcon_0.method_6(point_0);
			}

			internal void method_1()
			{
				taskbarIcon_0.LeftClickCommand.smethod_7(taskbarIcon_0.LeftClickCommandParameter, taskbarIcon_0.LeftClickCommandTarget ?? taskbarIcon_0);
				taskbarIcon_0.method_7(point_0);
			}
		}

		private NotifyIconData notifyIconData_0;

		private readonly WindowMessageSink windowMessageSink_0;

		private Action action_0;

		private readonly Timer timer_0;

		private readonly Timer timer_1;

		[CompilerGenerated]
		private bool bool_0;

		[CompilerGenerated]
		private bool bool_1;

		/// <summary>
		/// Category name that is set on designer properties.
		/// </summary>
		public const string CategoryName = "NotifyIcon";

		private static readonly DependencyPropertyKey dependencyPropertyKey_0;

		/// <summary>
		/// A read-only dependency property that returns the <see cref="T:System.Windows.Controls.Primitives.Popup" />
		/// that is being displayed in the taskbar area based on a user action.
		/// </summary>
		public static readonly DependencyProperty TrayPopupResolvedProperty;

		private static readonly DependencyPropertyKey dependencyPropertyKey_1;

		/// <summary>
		/// A read-only dependency property that returns the <see cref="T:System.Windows.Controls.ToolTip" />
		/// that is being displayed.
		/// </summary>
		public static readonly DependencyProperty TrayToolTipResolvedProperty;

		private static readonly DependencyPropertyKey dependencyPropertyKey_2;

		public static readonly DependencyProperty CustomBalloonProperty;

		private Icon icon_0;

		/// <summary>
		/// Resolves an image source and updates the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.Icon" /> property accordingly.
		/// </summary>
		public static readonly DependencyProperty IconSourceProperty;

		/// <summary>
		/// A tooltip text that is being displayed if no custom <see cref="T:System.Windows.Controls.ToolTip" />
		/// was set or if custom tooltips are not supported.
		/// </summary>
		public static readonly DependencyProperty ToolTipTextProperty;

		/// <summary>
		/// A custom UI element that is displayed as a tooltip if the user hovers over the taskbar icon.
		/// Works only with Vista and above. Accordingly, you should make sure that
		/// the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.ToolTipText" /> property is set as well.
		/// </summary>
		public static readonly DependencyProperty TrayToolTipProperty;

		/// <summary>
		/// A control that is displayed as a popup when the taskbar icon is clicked.
		/// </summary>
		public static readonly DependencyProperty TrayPopupProperty;

		/// <summary>
		/// Defines what mouse events display the context menu.
		/// Defaults to <see cref="F:Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.RightClick" />.
		/// </summary>
		public static readonly DependencyProperty MenuActivationProperty;

		/// <summary>
		/// Defines what mouse events trigger the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayPopup" />.
		/// Default is <see cref="F:Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.LeftClick" />.
		/// </summary>
		public static readonly DependencyProperty PopupActivationProperty;

		/// <summary>
		/// Associates a command that is being executed if the tray icon is being
		/// double clicked.
		/// </summary>
		public static readonly DependencyProperty DoubleClickCommandProperty;

		/// <summary>
		/// Command parameter for the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.DoubleClickCommand" />.
		/// </summary>
		public static readonly DependencyProperty DoubleClickCommandParameterProperty;

		/// <summary>
		/// The target of the command that is fired if the notify icon is double clicked.
		/// </summary>
		public static readonly DependencyProperty DoubleClickCommandTargetProperty;

		/// <summary>
		/// Associates a command that is being executed if the tray icon is being
		/// double clicked.
		/// </summary>
		public static readonly DependencyProperty LeftClickCommandProperty;

		/// <summary>
		/// Command parameter for the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.LeftClickCommand" />.
		/// </summary>
		public static readonly DependencyProperty LeftClickCommandParameterProperty;

		/// <summary>
		/// The target of the command that is fired if the notify icon is clicked.
		/// </summary>
		public static readonly DependencyProperty LeftClickCommandTargetProperty;

		/// <summary>
		/// TrayLeftMouseDown Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayLeftMouseDownEvent;

		/// <summary>
		/// TrayRightMouseDown Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayRightMouseDownEvent;

		/// <summary>
		/// TrayMiddleMouseDown Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayMiddleMouseDownEvent;

		/// <summary>
		/// TrayLeftMouseUp Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayLeftMouseUpEvent;

		/// <summary>
		/// TrayRightMouseUp Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayRightMouseUpEvent;

		/// <summary>
		/// TrayMiddleMouseUp Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayMiddleMouseUpEvent;

		/// <summary>
		/// TrayMouseDoubleClick Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayMouseDoubleClickEvent;

		/// <summary>
		/// TrayMouseMove Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayMouseMoveEvent;

		/// <summary>
		/// TrayBalloonTipShown Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayBalloonTipShownEvent;

		/// <summary>
		/// TrayBalloonTipClosed Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayBalloonTipClosedEvent;

		/// <summary>
		/// TrayBalloonTipClicked Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayBalloonTipClickedEvent;

		/// <summary>
		/// TrayContextMenuOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayContextMenuOpenEvent;

		/// <summary>
		/// PreviewTrayContextMenuOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent PreviewTrayContextMenuOpenEvent;

		/// <summary>
		/// TrayPopupOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayPopupOpenEvent;

		/// <summary>
		/// PreviewTrayPopupOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent PreviewTrayPopupOpenEvent;

		/// <summary>
		/// TrayToolTipOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayToolTipOpenEvent;

		/// <summary>
		/// PreviewTrayToolTipOpen Routed Event
		/// </summary>
		public static readonly RoutedEvent PreviewTrayToolTipOpenEvent;

		/// <summary>
		/// TrayToolTipClose Routed Event
		/// </summary>
		public static readonly RoutedEvent TrayToolTipCloseEvent;

		/// <summary>
		/// PreviewTrayToolTipClose Routed Event
		/// </summary>
		public static readonly RoutedEvent PreviewTrayToolTipCloseEvent;

		/// <summary>
		/// PopupOpened Attached Routed Event
		/// </summary>
		public static readonly RoutedEvent PopupOpenedEvent;

		/// <summary>
		/// ToolTipOpened Attached Routed Event
		/// </summary>
		public static readonly RoutedEvent ToolTipOpenedEvent;

		/// <summary>
		/// ToolTipClose Attached Routed Event
		/// </summary>
		public static readonly RoutedEvent ToolTipCloseEvent;

		/// <summary>
		/// BalloonShowing Attached Routed Event
		/// </summary>
		public static readonly RoutedEvent BalloonShowingEvent;

		/// <summary>
		/// BalloonClosing Attached Routed Event
		/// </summary>
		public static readonly RoutedEvent BalloonClosingEvent;

		/// <summary>
		/// An attached property that is assigned to 
		/// </summary>  
		public static readonly DependencyProperty ParentTaskbarIconProperty;

		/// <summary>
		/// Indicates whether the taskbar icon has been created or not.
		/// </summary>
		public bool IsTaskbarIconCreated
		{
			[CompilerGenerated]
			get
			{
				return bool_0;
			}
			[CompilerGenerated]
			private set
			{
				bool_0 = value;
			}
		}

		/// <summary>
		/// Indicates whether custom tooltips are supported, which depends
		/// on the OS. Windows Vista or higher is required in order to
		/// support this feature.
		/// </summary>
		public bool SupportsCustomToolTips => windowMessageSink_0.Version == NotifyIconVersion.Vista;

		private bool Boolean_0
		{
			get
			{
				Popup trayPopupResolved = TrayPopupResolved;
				ContextMenu contextMenu = base.ContextMenu;
				Popup customBalloon = CustomBalloon;
				if ((trayPopupResolved != null && trayPopupResolved.IsOpen) || (contextMenu != null && contextMenu.IsOpen))
				{
					return true;
				}
				return customBalloon?.IsOpen ?? false;
			}
		}

		/// <summary>
		/// Set to true as soon as <see cref="M:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.Dispose" />
		/// has been invoked.
		/// </summary>
		public bool IsDisposed
		{
			[CompilerGenerated]
			get
			{
				return bool_1;
			}
			[CompilerGenerated]
			private set
			{
				bool_1 = value;
			}
		}

		/// <summary>
		/// Gets the TrayPopupResolved property. Returns
		/// a <see cref="T:System.Windows.Controls.Primitives.Popup" /> which is either the
		/// <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayPopup" /> control itself or a
		/// <see cref="T:System.Windows.Controls.Primitives.Popup" /> control that contains the
		/// <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayPopup" />.
		/// </summary>
		[Category("NotifyIcon")]
		public Popup TrayPopupResolved => (Popup)GetValue(TrayPopupResolvedProperty);

		/// <summary>
		/// Gets the TrayToolTipResolved property. Returns 
		/// a <see cref="T:System.Windows.Controls.ToolTip" /> control that was created
		/// in order to display either <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayToolTip" />
		/// or <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.ToolTipText" />.
		/// </summary>
		[Browsable(true)]
		[Bindable(true)]
		[Category("NotifyIcon")]
		public ToolTip TrayToolTipResolved => (ToolTip)GetValue(TrayToolTipResolvedProperty);

		/// <summary>
		/// A custom popup that is being displayed in the tray area in order
		/// to display messages to the user.
		/// </summary>
		public Popup CustomBalloon => (Popup)GetValue(CustomBalloonProperty);

		/// <summary>
		/// Gets or sets the icon to be displayed. This is not a
		/// dependency property - if you want to assign the property
		/// through XAML, please use the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.IconSource" />
		/// dependency property.
		/// </summary>
		[Browsable(false)]
		public Icon Icon
		{
			get
			{
				return icon_0;
			}
			set
			{
				icon_0 = value;
				notifyIconData_0.IconHandle = ((value == null) ? IntPtr.Zero : icon_0.Handle);
				Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Modify, IconDataMembers.Icon);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.IconSourceProperty" />
		/// dependency property:<br />
		/// Resolves an image source and updates the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.Icon" /> property accordingly.
		/// </summary>
		[Category("NotifyIcon")]
		[Description("Sets the displayed taskbar icon.")]
		public ImageSource IconSource
		{
			get
			{
				return (ImageSource)GetValue(IconSourceProperty);
			}
			set
			{
				SetValue(IconSourceProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.ToolTipTextProperty" />
		/// dependency property:<br />
		/// A tooltip text that is being displayed if no custom <see cref="T:System.Windows.Controls.ToolTip" />
		/// was set or if custom tooltips are not supported.
		/// </summary>
		[Description("Alternative to a fully blown ToolTip, which is only displayed on Vista and above.")]
		[Category("NotifyIcon")]
		public string ToolTipText
		{
			get
			{
				return (string)GetValue(ToolTipTextProperty);
			}
			set
			{
				SetValue(ToolTipTextProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayToolTipProperty" />
		/// dependency property:<br />
		/// A custom UI element that is displayed as a tooltip if the user hovers over the taskbar icon.
		/// Works only with Vista and above. Accordingly, you should make sure that
		/// the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.ToolTipText" /> property is set as well.
		/// </summary>
		[Description("Custom UI element that is displayed as a tooltip. Only on Vista and above")]
		[Category("NotifyIcon")]
		public UIElement TrayToolTip
		{
			get
			{
				return (UIElement)GetValue(TrayToolTipProperty);
			}
			set
			{
				SetValue(TrayToolTipProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayPopupProperty" />
		/// dependency property:<br />
		/// A control that is displayed as a popup when the taskbar icon is clicked.
		/// </summary>
		[Category("NotifyIcon")]
		[Description("Displayed as a Popup if the user clicks on the taskbar icon.")]
		public UIElement TrayPopup
		{
			get
			{
				return (UIElement)GetValue(TrayPopupProperty);
			}
			set
			{
				SetValue(TrayPopupProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.MenuActivationProperty" />
		/// dependency property:<br />
		/// Defines what mouse events display the context menu.
		/// Defaults to <see cref="F:Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.RightClick" />.
		/// </summary>
		[Description("Defines what mouse events display the context menu.")]
		[Category("NotifyIcon")]
		public PopupActivationMode MenuActivation
		{
			get
			{
				return (PopupActivationMode)GetValue(MenuActivationProperty);
			}
			set
			{
				SetValue(MenuActivationProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.PopupActivationProperty" />
		/// dependency property:<br />
		/// Defines what mouse events trigger the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayPopup" />.
		/// Default is <see cref="F:Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.LeftClick" />.
		/// </summary>
		[Category("NotifyIcon")]
		[Description("Defines what mouse events display the TaskbarIconPopup.")]
		public PopupActivationMode PopupActivation
		{
			get
			{
				return (PopupActivationMode)GetValue(PopupActivationProperty);
			}
			set
			{
				SetValue(PopupActivationProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.DoubleClickCommandProperty" />
		/// dependency property:<br />
		/// Associates a command that is being executed if the tray icon is being
		/// double clicked.
		/// </summary>
		public ICommand DoubleClickCommand
		{
			get
			{
				return (ICommand)GetValue(DoubleClickCommandProperty);
			}
			set
			{
				SetValue(DoubleClickCommandProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.DoubleClickCommandParameterProperty" />
		/// dependency property:<br />
		/// Command parameter for the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.DoubleClickCommand" />.
		/// </summary>
		public object DoubleClickCommandParameter
		{
			get
			{
				return GetValue(DoubleClickCommandParameterProperty);
			}
			set
			{
				SetValue(DoubleClickCommandParameterProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.DoubleClickCommandTargetProperty" />
		/// dependency property:<br />
		/// The target of the command that is fired if the notify icon is double clicked.
		/// </summary>
		public IInputElement DoubleClickCommandTarget
		{
			get
			{
				return (IInputElement)GetValue(DoubleClickCommandTargetProperty);
			}
			set
			{
				SetValue(DoubleClickCommandTargetProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.LeftClickCommandProperty" />
		/// dependency property:<br />
		/// Associates a command that is being executed if the tray icon is being
		/// double clicked.
		/// </summary>
		public ICommand LeftClickCommand
		{
			get
			{
				return (ICommand)GetValue(LeftClickCommandProperty);
			}
			set
			{
				SetValue(LeftClickCommandProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.LeftClickCommandParameterProperty" />
		/// dependency property:<br />
		/// Command parameter for the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.LeftClickCommand" />.
		/// </summary>
		public object LeftClickCommandParameter
		{
			get
			{
				return GetValue(LeftClickCommandParameterProperty);
			}
			set
			{
				SetValue(LeftClickCommandParameterProperty, value);
			}
		}

		/// <summary>
		/// A property wrapper for the <see cref="F:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.LeftClickCommandTargetProperty" />
		/// dependency property:<br />
		/// The target of the command that is fired if the notify icon is clicked.
		/// </summary>
		public IInputElement LeftClickCommandTarget
		{
			get
			{
				return (IInputElement)GetValue(LeftClickCommandTargetProperty);
			}
			set
			{
				SetValue(LeftClickCommandTargetProperty, value);
			}
		}

		/// <summary>
		/// Occurs when the user presses the left mouse button.
		/// </summary>
		[Category("NotifyIcon")]
		public event RoutedEventHandler TrayLeftMouseDown
		{
			add
			{
				AddHandler(TrayLeftMouseDownEvent, value);
			}
			remove
			{
				RemoveHandler(TrayLeftMouseDownEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the presses the right mouse button.
		/// </summary>
		public event RoutedEventHandler TrayRightMouseDown
		{
			add
			{
				AddHandler(TrayRightMouseDownEvent, value);
			}
			remove
			{
				RemoveHandler(TrayRightMouseDownEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user presses the middle mouse button.
		/// </summary>
		public event RoutedEventHandler TrayMiddleMouseDown
		{
			add
			{
				AddHandler(TrayMiddleMouseDownEvent, value);
			}
			remove
			{
				RemoveHandler(TrayMiddleMouseDownEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user releases the left mouse button.
		/// </summary>
		public event RoutedEventHandler TrayLeftMouseUp
		{
			add
			{
				AddHandler(TrayLeftMouseUpEvent, value);
			}
			remove
			{
				RemoveHandler(TrayLeftMouseUpEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user releases the right mouse button.
		/// </summary>
		public event RoutedEventHandler TrayRightMouseUp
		{
			add
			{
				AddHandler(TrayRightMouseUpEvent, value);
			}
			remove
			{
				RemoveHandler(TrayRightMouseUpEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user releases the middle mouse button.
		/// </summary>
		public event RoutedEventHandler TrayMiddleMouseUp
		{
			add
			{
				AddHandler(TrayMiddleMouseUpEvent, value);
			}
			remove
			{
				RemoveHandler(TrayMiddleMouseUpEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user double-clicks the taskbar icon.
		/// </summary>
		public event RoutedEventHandler TrayMouseDoubleClick
		{
			add
			{
				AddHandler(TrayMouseDoubleClickEvent, value);
			}
			remove
			{
				RemoveHandler(TrayMouseDoubleClickEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user moves the mouse over the taskbar icon.
		/// </summary>
		public event RoutedEventHandler TrayMouseMove
		{
			add
			{
				AddHandler(TrayMouseMoveEvent, value);
			}
			remove
			{
				RemoveHandler(TrayMouseMoveEvent, value);
			}
		}

		/// <summary>
		/// Occurs when a balloon ToolTip is displayed.
		/// </summary>
		public event RoutedEventHandler TrayBalloonTipShown
		{
			add
			{
				AddHandler(TrayBalloonTipShownEvent, value);
			}
			remove
			{
				RemoveHandler(TrayBalloonTipShownEvent, value);
			}
		}

		/// <summary>
		/// Occurs when a balloon ToolTip was closed.
		/// </summary>
		public event RoutedEventHandler TrayBalloonTipClosed
		{
			add
			{
				AddHandler(TrayBalloonTipClosedEvent, value);
			}
			remove
			{
				RemoveHandler(TrayBalloonTipClosedEvent, value);
			}
		}

		/// <summary>
		/// Occurs when the user clicks on a balloon ToolTip.
		/// </summary>
		public event RoutedEventHandler TrayBalloonTipClicked
		{
			add
			{
				AddHandler(TrayBalloonTipClickedEvent, value);
			}
			remove
			{
				RemoveHandler(TrayBalloonTipClickedEvent, value);
			}
		}

		/// <summary>
		/// Bubbled event that occurs when the context menu of the taskbar icon is being displayed.
		/// </summary>
		public event RoutedEventHandler TrayContextMenuOpen
		{
			add
			{
				AddHandler(TrayContextMenuOpenEvent, value);
			}
			remove
			{
				RemoveHandler(TrayContextMenuOpenEvent, value);
			}
		}

		/// <summary>
		/// Tunneled event that occurs when the context menu of the taskbar icon is being displayed.
		/// </summary>
		public event RoutedEventHandler PreviewTrayContextMenuOpen
		{
			add
			{
				AddHandler(PreviewTrayContextMenuOpenEvent, value);
			}
			remove
			{
				RemoveHandler(PreviewTrayContextMenuOpenEvent, value);
			}
		}

		/// <summary>
		/// Bubbled event that occurs when the custom popup is being opened.
		/// </summary>
		public event RoutedEventHandler TrayPopupOpen
		{
			add
			{
				AddHandler(TrayPopupOpenEvent, value);
			}
			remove
			{
				RemoveHandler(TrayPopupOpenEvent, value);
			}
		}

		/// <summary>
		/// Tunneled event that occurs when the custom popup is being opened.
		/// </summary>
		public event RoutedEventHandler PreviewTrayPopupOpen
		{
			add
			{
				AddHandler(PreviewTrayPopupOpenEvent, value);
			}
			remove
			{
				RemoveHandler(PreviewTrayPopupOpenEvent, value);
			}
		}

		/// <summary>
		/// Bubbled event that occurs when the custom ToolTip is being displayed.
		/// </summary>
		public event RoutedEventHandler TrayToolTipOpen
		{
			add
			{
				AddHandler(TrayToolTipOpenEvent, value);
			}
			remove
			{
				RemoveHandler(TrayToolTipOpenEvent, value);
			}
		}

		/// <summary>
		/// Tunneled event that occurs when the custom ToolTip is being displayed.
		/// </summary>
		public event RoutedEventHandler PreviewTrayToolTipOpen
		{
			add
			{
				AddHandler(PreviewTrayToolTipOpenEvent, value);
			}
			remove
			{
				RemoveHandler(PreviewTrayToolTipOpenEvent, value);
			}
		}

		/// <summary>
		/// Bubbled event that occurs when a custom tooltip is being closed.
		/// </summary>
		public event RoutedEventHandler TrayToolTipClose
		{
			add
			{
				AddHandler(TrayToolTipCloseEvent, value);
			}
			remove
			{
				RemoveHandler(TrayToolTipCloseEvent, value);
			}
		}

		/// <summary>
		/// Tunneled event that occurs when a custom tooltip is being closed.
		/// </summary>
		public event RoutedEventHandler PreviewTrayToolTipClose
		{
			add
			{
				AddHandler(PreviewTrayToolTipCloseEvent, value);
			}
			remove
			{
				RemoveHandler(PreviewTrayToolTipCloseEvent, value);
			}
		}

		/// <summary>
		/// Inits the taskbar icon and registers a message listener
		/// in order to receive events from the taskbar area.
		/// </summary>
		public TaskbarIcon()
		{
			windowMessageSink_0 = (Class3.Boolean_0 ? WindowMessageSink.smethod_0() : new WindowMessageSink(NotifyIconVersion.Win95));
			notifyIconData_0 = NotifyIconData.CreateDefault(windowMessageSink_0.IntPtr_0);
			method_13();
			windowMessageSink_0.MouseEventReceived += method_1;
			windowMessageSink_0.TaskbarCreated += method_12;
			windowMessageSink_0.ChangeToolTipStateRequest += method_2;
			windowMessageSink_0.BallonToolTipChanged += method_8;
			timer_0 = new Timer(method_10);
			timer_1 = new Timer(method_0);
			if (Application.Current != null)
			{
				Application.Current.Exit += method_16;
			}
		}

		/// <summary>
		/// Shows a custom control as a tooltip in the tray location.
		/// </summary>
		/// <param name="balloon"></param>
		/// <param name="animation">An optional animation for the popup.</param>
		/// <param name="timeout">The time after which the popup is being closed.
		/// Submit null in order to keep the balloon open inde
		/// </param>
		/// <exception cref="T:System.ArgumentNullException">If <paramref name="balloon" />
		/// is a null reference.</exception>
		public void ShowCustomBalloon(UIElement balloon, PopupAnimation animation, int? timeout)
		{
			if (!Application.Current.Dispatcher.CheckAccess())
			{
				Action method = delegate
				{
					ShowCustomBalloon(balloon, animation, timeout);
				};
				Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, method);
				return;
			}
			if (balloon == null)
			{
				throw new ArgumentNullException("balloon");
			}
			if (timeout.HasValue && timeout < 500)
			{
				string format = "Invalid timeout of {0} milliseconds. Timeout must be at least 500 ms";
				format = string.Format(format, timeout);
				throw new ArgumentOutOfRangeException("timeout", format);
			}
			method_15();
			lock (this)
			{
				CloseBalloon();
			}
			Popup popup = new Popup();
			popup.AllowsTransparency = true;
			method_23(popup, null, base.DataContext);
			popup.PopupAnimation = animation;
			popup.Child = balloon;
			popup.Placement = PlacementMode.AbsolutePoint;
			popup.StaysOpen = true;
			Hardcodet.Wpf.TaskbarNotification.Interop.Point trayLocation = TrayInfo.GetTrayLocation();
			popup.HorizontalOffset = trayLocation.X - 1;
			popup.VerticalOffset = trayLocation.Y - 1;
			lock (this)
			{
				SetCustomBalloon(popup);
			}
			SetParentTaskbarIcon(balloon, this);
			smethod_29(balloon, this);
			popup.IsOpen = true;
			if (timeout.HasValue)
			{
				timer_1.Change(timeout.Value, -1);
			}
		}

		/// <summary>
		/// Resets the closing timeout, which effectively
		/// keeps a displayed balloon message open until
		/// it is either closed programmatically through
		/// <see cref="M:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.CloseBalloon" /> or due to a new
		/// message being displayed.
		/// </summary>
		public void ResetBalloonCloseTimer()
		{
			if (!IsDisposed)
			{
				lock (this)
				{
					timer_1.Change(-1, -1);
				}
			}
		}

		/// <summary>
		/// Closes the current <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.CustomBalloon" />, if the
		/// property is set.
		/// </summary>
		public void CloseBalloon()
		{
			if (IsDisposed)
			{
				return;
			}
			if (!Application.Current.Dispatcher.CheckAccess())
			{
				Action method = CloseBalloon;
				Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, method);
				return;
			}
			lock (this)
			{
				timer_1.Change(-1, -1);
				Popup customBalloon = CustomBalloon;
				if (customBalloon == null)
				{
					return;
				}
				UIElement child = customBalloon.Child;
				if (!smethod_30(child, this).Handled)
				{
					customBalloon.IsOpen = false;
					if (child != null)
					{
						SetParentTaskbarIcon(child, null);
					}
				}
				SetCustomBalloon(null);
			}
		}

		private void method_0(object object_0)
		{
			if (!IsDisposed)
			{
				Action callback = CloseBalloon;
				Application.Current.Dispatcher.Invoke(callback);
			}
		}

		private void method_1(MouseEvent mouseEvent_0)
		{
			if (IsDisposed)
			{
				return;
			}
			switch (mouseEvent_0)
			{
			default:
				throw new ArgumentOutOfRangeException("me", "Missing handler for mouse event flag: " + mouseEvent_0);
			case MouseEvent.MouseMove:
				RaiseTrayMouseMoveEvent();
				return;
			case MouseEvent.IconRightMouseDown:
				RaiseTrayRightMouseDownEvent();
				break;
			case MouseEvent.IconLeftMouseDown:
				RaiseTrayLeftMouseDownEvent();
				break;
			case MouseEvent.IconRightMouseUp:
				RaiseTrayRightMouseUpEvent();
				break;
			case MouseEvent.IconLeftMouseUp:
				RaiseTrayLeftMouseUpEvent();
				break;
			case MouseEvent.IconMiddleMouseDown:
				RaiseTrayMiddleMouseDownEvent();
				break;
			case MouseEvent.IconMiddleMouseUp:
				RaiseTrayMiddleMouseUpEvent();
				break;
			case MouseEvent.IconDoubleClick:
				timer_0.Change(-1, -1);
				RaiseTrayMouseDoubleClickEvent();
				break;
			case MouseEvent.BalloonToolTipClicked:
				RaiseTrayBalloonTipClickedEvent();
				break;
			}
			Hardcodet.Wpf.TaskbarNotification.Interop.Point point_0 = default(Hardcodet.Wpf.TaskbarNotification.Interop.Point);
			Class5.GetCursorPos(ref point_0);
			bool flag = false;
			if (mouseEvent_0.smethod_6(PopupActivation))
			{
				if (mouseEvent_0 == MouseEvent.IconLeftMouseUp)
				{
					action_0 = delegate
					{
						LeftClickCommand.smethod_7(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
						method_6(point_0);
					};
					timer_0.Change(Class5.GetDoubleClickTime(), -1);
					flag = true;
				}
				else
				{
					method_6(point_0);
				}
			}
			if (mouseEvent_0.smethod_6(MenuActivation))
			{
				if (mouseEvent_0 == MouseEvent.IconLeftMouseUp)
				{
					action_0 = delegate
					{
						LeftClickCommand.smethod_7(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
						method_7(point_0);
					};
					timer_0.Change(Class5.GetDoubleClickTime(), -1);
					flag = true;
				}
				else
				{
					method_7(point_0);
				}
			}
			if (mouseEvent_0 == MouseEvent.IconLeftMouseUp && !flag)
			{
				action_0 = delegate
				{
					LeftClickCommand.smethod_7(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
				};
				timer_0.Change(Class5.GetDoubleClickTime(), -1);
			}
		}

		private void method_2(bool bool_2)
		{
			if (TrayToolTipResolved == null)
			{
				return;
			}
			if (bool_2)
			{
				if (!Boolean_0 && !RaisePreviewTrayToolTipOpenEvent().Handled)
				{
					TrayToolTipResolved.IsOpen = true;
					if (TrayToolTip != null)
					{
						smethod_27(TrayToolTip);
					}
					RaiseTrayToolTipOpenEvent();
				}
			}
			else if (!RaisePreviewTrayToolTipCloseEvent().Handled)
			{
				if (TrayToolTip != null)
				{
					smethod_28(TrayToolTip);
				}
				TrayToolTipResolved.IsOpen = false;
				RaiseTrayToolTipCloseEvent();
			}
		}

		private void method_3()
		{
			ToolTip toolTip = TrayToolTip as ToolTip;
			if (toolTip == null && TrayToolTip != null)
			{
				toolTip = new ToolTip();
				toolTip.Placement = PlacementMode.Mouse;
				toolTip.HasDropShadow = false;
				toolTip.BorderThickness = new Thickness(0.0);
				toolTip.Background = System.Windows.Media.Brushes.Transparent;
				toolTip.StaysOpen = true;
				toolTip.Content = TrayToolTip;
			}
			else if (toolTip == null && !string.IsNullOrEmpty(ToolTipText))
			{
				toolTip = new ToolTip();
				toolTip.Content = ToolTipText;
			}
			if (toolTip != null)
			{
				method_23(toolTip, null, base.DataContext);
			}
			SetTrayToolTipResolved(toolTip);
		}

		private void method_4()
		{
			notifyIconData_0.ToolTipText = ToolTipText;
			if (windowMessageSink_0.Version == NotifyIconVersion.Vista && string.IsNullOrEmpty(notifyIconData_0.ToolTipText) && TrayToolTipResolved != null)
			{
				notifyIconData_0.ToolTipText = "ToolTip";
			}
			Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Modify, IconDataMembers.Tip);
		}

		private void method_5()
		{
			Popup popup = TrayPopup as Popup;
			if (popup == null && TrayPopup != null)
			{
				popup = new Popup();
				popup.AllowsTransparency = true;
				popup.PopupAnimation = PopupAnimation.None;
				popup.Child = TrayPopup;
				popup.Placement = PlacementMode.AbsolutePoint;
				popup.StaysOpen = false;
			}
			if (popup != null)
			{
				method_23(popup, null, base.DataContext);
			}
			SetTrayPopupResolved(popup);
		}

		private void method_6(Hardcodet.Wpf.TaskbarNotification.Interop.Point point_0)
		{
			if (!IsDisposed && !RaisePreviewTrayPopupOpenEvent().Handled && TrayPopup != null)
			{
				TrayPopupResolved.Placement = PlacementMode.AbsolutePoint;
				TrayPopupResolved.HorizontalOffset = point_0.X;
				TrayPopupResolved.VerticalOffset = point_0.Y;
				TrayPopupResolved.IsOpen = true;
				Class5.SetForegroundWindow(windowMessageSink_0.IntPtr_0);
				if (TrayPopup != null)
				{
					smethod_26(TrayPopup);
				}
				RaiseTrayPopupOpenEvent();
			}
		}

		private void method_7(Hardcodet.Wpf.TaskbarNotification.Interop.Point point_0)
		{
			if (!IsDisposed && !RaisePreviewTrayContextMenuOpenEvent().Handled && base.ContextMenu != null)
			{
				base.ContextMenu.Placement = PlacementMode.AbsolutePoint;
				base.ContextMenu.HorizontalOffset = point_0.X;
				base.ContextMenu.VerticalOffset = point_0.Y;
				base.ContextMenu.IsOpen = true;
				Class5.SetForegroundWindow(windowMessageSink_0.IntPtr_0);
				RaiseTrayContextMenuOpenEvent();
			}
		}

		private void method_8(bool bool_2)
		{
			if (bool_2)
			{
				RaiseTrayBalloonTipShownEvent();
			}
			else
			{
				RaiseTrayBalloonTipClosedEvent();
			}
		}

		/// <summary>
		/// Displays a balloon tip with the specified title,
		/// text, and icon in the taskbar for the specified time period.
		/// </summary>
		/// <param name="title">The title to display on the balloon tip.</param>
		/// <param name="message">The text to display on the balloon tip.</param>
		/// <param name="symbol">A symbol that indicates the severity.</param>
		public void ShowBalloonTip(string title, string message, BalloonIcon symbol)
		{
			lock (this)
			{
				method_9(title, message, symbol.smethod_3(), IntPtr.Zero);
			}
		}

		/// <summary>
		/// Displays a balloon tip with the specified title,
		/// text, and a custom icon in the taskbar for the specified time period.
		/// </summary>
		/// <param name="title">The title to display on the balloon tip.</param>
		/// <param name="message">The text to display on the balloon tip.</param>
		/// <param name="customIcon">A custom icon.</param>
		/// <exception cref="T:System.ArgumentNullException">If <paramref name="customIcon" />
		/// is a null reference.</exception>
		public void ShowBalloonTip(string title, string message, Icon customIcon)
		{
			if (customIcon == null)
			{
				throw new ArgumentNullException("customIcon");
			}
			lock (this)
			{
				method_9(title, message, BalloonFlags.User, customIcon.Handle);
			}
		}

		private void method_9(string string_0, string string_1, BalloonFlags balloonFlags_0, IntPtr intptr_0)
		{
			method_15();
			notifyIconData_0.BalloonText = string_1 ?? string.Empty;
			notifyIconData_0.BalloonTitle = string_0 ?? string.Empty;
			notifyIconData_0.BalloonFlags = balloonFlags_0;
			notifyIconData_0.CustomBalloonIconHandle = intptr_0;
			Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Modify, IconDataMembers.Icon | IconDataMembers.Info);
		}

		/// <summary>
		/// Hides a balloon ToolTip, if any is displayed.
		/// </summary>
		public void HideBalloonTip()
		{
			method_15();
			notifyIconData_0.BalloonText = (notifyIconData_0.BalloonTitle = string.Empty);
			Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Modify, IconDataMembers.Info);
		}

		private void method_10(object object_0)
		{
			if (!IsDisposed)
			{
				Action action = action_0;
				if (action != null)
				{
					action_0 = null;
					Application.Current.Dispatcher.Invoke(action);
				}
			}
		}

		private void method_11()
		{
			notifyIconData_0.VersionOrTimeout = 4u;
			bool flag;
			if (!(flag = Class5.Shell_NotifyIcon(NotifyCommand.SetVersion, ref notifyIconData_0)))
			{
				notifyIconData_0.VersionOrTimeout = 3u;
				flag = Class3.smethod_1(ref notifyIconData_0, NotifyCommand.SetVersion);
			}
			if (!flag)
			{
				notifyIconData_0.VersionOrTimeout = 0u;
				flag = Class3.smethod_1(ref notifyIconData_0, NotifyCommand.SetVersion);
			}
		}

		private void method_12()
		{
			IsTaskbarIconCreated = false;
			method_13();
		}

		private void method_13()
		{
			lock (this)
			{
				if (!IsTaskbarIconCreated)
				{
					if (!Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Add, IconDataMembers.Message | IconDataMembers.Icon | IconDataMembers.Tip))
					{
						throw new Win32Exception("Could not create icon data");
					}
					method_11();
					windowMessageSink_0.Version = (NotifyIconVersion)notifyIconData_0.VersionOrTimeout;
					IsTaskbarIconCreated = true;
				}
			}
		}

		private void method_14()
		{
			lock (this)
			{
				if (IsTaskbarIconCreated)
				{
					Class3.smethod_2(ref notifyIconData_0, NotifyCommand.Delete, IconDataMembers.Message);
					IsTaskbarIconCreated = false;
				}
			}
		}

		private void method_15()
		{
			if (IsDisposed)
			{
				throw new ObjectDisposedException(base.Name ?? GetType().FullName);
			}
		}

		private void method_16(object sender, EventArgs e)
		{
			Dispose();
		}

		/// <summary>
		/// This destructor will run only if the <see cref="M:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.Dispose" />
		/// method does not get called. This gives this base class the
		/// opportunity to finalize.
		/// <para>
		/// Important: Do not provide destructors in types derived from
		/// this class.
		/// </para>
		/// </summary>
		~TaskbarIcon()
		{
			method_17(bool_2: false);
		}

		/// <summary>
		/// Disposes the object.
		/// </summary>
		/// <remarks>This method is not virtual by design. Derived classes
		/// should override <see cref="M:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.Dispose(System.Boolean)" />.
		/// </remarks>
		public void Dispose()
		{
			method_17(bool_2: true);
			GC.SuppressFinalize(this);
		}

		private void method_17(bool bool_2)
		{
			if (!IsDisposed && bool_2)
			{
				lock (this)
				{
					IsDisposed = true;
					Application.Current.Exit -= method_16;
					timer_0.Dispose();
					timer_1.Dispose();
					windowMessageSink_0.Dispose();
					method_14();
				}
			}
		}

		/// <summary>
		/// Provides a secure method for setting the TrayPopupResolved property.  
		/// This dependency property indicates ....
		/// </summary>
		/// <param name="value">The new value for the property.</param>
		protected void SetTrayPopupResolved(Popup value)
		{
			SetValue(dependencyPropertyKey_0, value);
		}

		/// <summary>
		/// Provides a secure method for setting the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.TrayToolTipResolved" />
		/// property.  
		/// </summary>
		/// <param name="value">The new value for the property.</param>
		protected void SetTrayToolTipResolved(ToolTip value)
		{
			SetValue(dependencyPropertyKey_1, value);
		}

		/// <summary>
		/// Provides a secure method for setting the <see cref="P:Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.CustomBalloon" /> property.  
		/// </summary>
		/// <param name="value">The new value for the property.</param>
		protected void SetCustomBalloon(Popup value)
		{
			SetValue(dependencyPropertyKey_2, value);
		}

		private static void smethod_0(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_18(dependencyPropertyChangedEventArgs_0);
		}

		private void method_18(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			ImageSource imageSource_ = (ImageSource)dependencyPropertyChangedEventArgs_0.NewValue;
			if (!Class3.Boolean_0)
			{
				Icon = imageSource_.smethod_4();
			}
		}

		private static void smethod_1(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_19(dependencyPropertyChangedEventArgs_0);
		}

		private void method_19(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (TrayToolTipResolved == null || TrayToolTipResolved.Content is string)
			{
				method_3();
			}
			method_4();
		}

		private static void smethod_2(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_20(dependencyPropertyChangedEventArgs_0);
		}

		private void method_20(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			method_3();
			if (dependencyPropertyChangedEventArgs_0.OldValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.OldValue, null);
			}
			if (dependencyPropertyChangedEventArgs_0.NewValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.NewValue, this);
			}
			method_4();
		}

		private static void smethod_3(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_21(dependencyPropertyChangedEventArgs_0);
		}

		private void method_21(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (dependencyPropertyChangedEventArgs_0.OldValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.OldValue, null);
			}
			if (dependencyPropertyChangedEventArgs_0.NewValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.NewValue, this);
			}
			method_5();
		}

		private static void smethod_4(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_22(dependencyPropertyChangedEventArgs_0);
		}

		private void method_22(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if ((Visibility)dependencyPropertyChangedEventArgs_0.NewValue == Visibility.Visible)
			{
				method_13();
			}
			else
			{
				method_14();
			}
		}

		private void method_23(FrameworkElement frameworkElement_0, object object_0, object object_1)
		{
			if (frameworkElement_0 != null && !frameworkElement_0.smethod_8() && (this == frameworkElement_0.DataContext || object.Equals(object_0, frameworkElement_0.DataContext)))
			{
				frameworkElement_0.DataContext = object_1 ?? this;
			}
		}

		private static void smethod_5(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_24(dependencyPropertyChangedEventArgs_0);
		}

		private void method_24(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			object newValue = dependencyPropertyChangedEventArgs_0.NewValue;
			object oldValue = dependencyPropertyChangedEventArgs_0.OldValue;
			method_23(TrayPopupResolved, oldValue, newValue);
			method_23(TrayToolTipResolved, oldValue, newValue);
			method_23(base.ContextMenu, oldValue, newValue);
		}

		private static void smethod_6(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			((TaskbarIcon)dependencyObject_0).method_25(dependencyPropertyChangedEventArgs_0);
		}

		private void method_25(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (dependencyPropertyChangedEventArgs_0.OldValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.OldValue, null);
			}
			if (dependencyPropertyChangedEventArgs_0.NewValue != null)
			{
				SetParentTaskbarIcon((DependencyObject)dependencyPropertyChangedEventArgs_0.NewValue, this);
			}
			method_23((ContextMenu)dependencyPropertyChangedEventArgs_0.NewValue, null, base.DataContext);
		}

		/// <summary>
		/// A helper method to raise the TrayLeftMouseDown event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayLeftMouseDownEvent()
		{
			return smethod_7(this);
		}

		internal static RoutedEventArgs smethod_7(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayLeftMouseDownEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayRightMouseDown event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayRightMouseDownEvent()
		{
			return smethod_8(this);
		}

		internal static RoutedEventArgs smethod_8(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayRightMouseDownEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayMiddleMouseDown event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayMiddleMouseDownEvent()
		{
			return smethod_9(this);
		}

		internal static RoutedEventArgs smethod_9(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayMiddleMouseDownEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayLeftMouseUp event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayLeftMouseUpEvent()
		{
			return smethod_10(this);
		}

		internal static RoutedEventArgs smethod_10(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayLeftMouseUpEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayRightMouseUp event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayRightMouseUpEvent()
		{
			return smethod_11(this);
		}

		internal static RoutedEventArgs smethod_11(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayRightMouseUpEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayMiddleMouseUp event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayMiddleMouseUpEvent()
		{
			return smethod_12(this);
		}

		internal static RoutedEventArgs smethod_12(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayMiddleMouseUpEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayMouseDoubleClick event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayMouseDoubleClickEvent()
		{
			RoutedEventArgs result = smethod_13(this);
			DoubleClickCommand.smethod_7(DoubleClickCommandParameter, DoubleClickCommandTarget ?? this);
			return result;
		}

		internal static RoutedEventArgs smethod_13(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayMouseDoubleClickEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayMouseMove event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayMouseMoveEvent()
		{
			return smethod_14(this);
		}

		internal static RoutedEventArgs smethod_14(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayMouseMoveEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayBalloonTipShown event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayBalloonTipShownEvent()
		{
			return smethod_15(this);
		}

		internal static RoutedEventArgs smethod_15(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayBalloonTipShownEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayBalloonTipClosed event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayBalloonTipClosedEvent()
		{
			return smethod_16(this);
		}

		internal static RoutedEventArgs smethod_16(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayBalloonTipClosedEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayBalloonTipClicked event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayBalloonTipClickedEvent()
		{
			return smethod_17(this);
		}

		internal static RoutedEventArgs smethod_17(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayBalloonTipClickedEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayContextMenuOpen event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayContextMenuOpenEvent()
		{
			return smethod_18(this);
		}

		internal static RoutedEventArgs smethod_18(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayContextMenuOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the PreviewTrayContextMenuOpen event.
		/// </summary>
		protected RoutedEventArgs RaisePreviewTrayContextMenuOpenEvent()
		{
			return smethod_19(this);
		}

		internal static RoutedEventArgs smethod_19(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = PreviewTrayContextMenuOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayPopupOpen event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayPopupOpenEvent()
		{
			return smethod_20(this);
		}

		internal static RoutedEventArgs smethod_20(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayPopupOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the PreviewTrayPopupOpen event.
		/// </summary>
		protected RoutedEventArgs RaisePreviewTrayPopupOpenEvent()
		{
			return smethod_21(this);
		}

		internal static RoutedEventArgs smethod_21(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = PreviewTrayPopupOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayToolTipOpen event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayToolTipOpenEvent()
		{
			return smethod_22(this);
		}

		internal static RoutedEventArgs smethod_22(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayToolTipOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the PreviewTrayToolTipOpen event.
		/// </summary>
		protected RoutedEventArgs RaisePreviewTrayToolTipOpenEvent()
		{
			return smethod_23(this);
		}

		internal static RoutedEventArgs smethod_23(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = PreviewTrayToolTipOpenEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the TrayToolTipClose event.
		/// </summary>
		protected RoutedEventArgs RaiseTrayToolTipCloseEvent()
		{
			return smethod_24(this);
		}

		internal static RoutedEventArgs smethod_24(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = TrayToolTipCloseEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// A helper method to raise the PreviewTrayToolTipClose event.
		/// </summary>
		protected RoutedEventArgs RaisePreviewTrayToolTipCloseEvent()
		{
			return smethod_25(this);
		}

		internal static RoutedEventArgs smethod_25(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = PreviewTrayToolTipCloseEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Adds a handler for the PopupOpened attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be added</param>
		public static void AddPopupOpenedHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_1(element, PopupOpenedEvent, handler);
		}

		/// <summary>
		/// Removes a handler for the PopupOpened attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be removed</param>
		public static void RemovePopupOpenedHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_2(element, PopupOpenedEvent, handler);
		}

		internal static RoutedEventArgs smethod_26(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = PopupOpenedEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Adds a handler for the ToolTipOpened attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be added</param>
		public static void AddToolTipOpenedHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_1(element, ToolTipOpenedEvent, handler);
		}

		/// <summary>
		/// Removes a handler for the ToolTipOpened attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be removed</param>
		public static void RemoveToolTipOpenedHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_2(element, ToolTipOpenedEvent, handler);
		}

		internal static RoutedEventArgs smethod_27(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = ToolTipOpenedEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Adds a handler for the ToolTipClose attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be added</param>
		public static void AddToolTipCloseHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_1(element, ToolTipCloseEvent, handler);
		}

		/// <summary>
		/// Removes a handler for the ToolTipClose attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be removed</param>
		public static void RemoveToolTipCloseHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_2(element, ToolTipCloseEvent, handler);
		}

		internal static RoutedEventArgs smethod_28(DependencyObject dependencyObject_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs();
			routedEventArgs.RoutedEvent = ToolTipCloseEvent;
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Adds a handler for the BalloonShowing attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be added</param>
		public static void AddBalloonShowingHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_1(element, BalloonShowingEvent, handler);
		}

		/// <summary>
		/// Removes a handler for the BalloonShowing attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be removed</param>
		public static void RemoveBalloonShowingHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_2(element, BalloonShowingEvent, handler);
		}

		internal static RoutedEventArgs smethod_29(DependencyObject dependencyObject_0, TaskbarIcon taskbarIcon_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs(BalloonShowingEvent, taskbarIcon_0);
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Adds a handler for the BalloonClosing attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be added</param>
		public static void AddBalloonClosingHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_1(element, BalloonClosingEvent, handler);
		}

		/// <summary>
		/// Removes a handler for the BalloonClosing attached event
		/// </summary>
		/// <param name="element">UIElement or ContentElement that listens to the event</param>
		/// <param name="handler">Event handler to be removed</param>
		public static void RemoveBalloonClosingHandler(DependencyObject element, RoutedEventHandler handler)
		{
			Class0.smethod_2(element, BalloonClosingEvent, handler);
		}

		internal static RoutedEventArgs smethod_30(DependencyObject dependencyObject_0, TaskbarIcon taskbarIcon_0)
		{
			if (dependencyObject_0 == null)
			{
				return null;
			}
			RoutedEventArgs routedEventArgs = new RoutedEventArgs(BalloonClosingEvent, taskbarIcon_0);
			Class0.smethod_0(dependencyObject_0, routedEventArgs);
			return routedEventArgs;
		}

		/// <summary>
		/// Gets the ParentTaskbarIcon property.  This dependency property 
		/// indicates ....
		/// </summary>
		public static TaskbarIcon GetParentTaskbarIcon(DependencyObject d)
		{
			return (TaskbarIcon)d.GetValue(ParentTaskbarIconProperty);
		}

		/// <summary>
		/// Sets the ParentTaskbarIcon property.  This dependency property 
		/// indicates ....
		/// </summary>
		public static void SetParentTaskbarIcon(DependencyObject d, TaskbarIcon value)
		{
			d.SetValue(ParentTaskbarIconProperty, value);
		}

		/// <summary>
		/// Registers properties.
		/// </summary>
		static TaskbarIcon()
		{
			dependencyPropertyKey_0 = DependencyProperty.RegisterReadOnly("TrayPopupResolved", typeof(Popup), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			TrayPopupResolvedProperty = dependencyPropertyKey_0.DependencyProperty;
			dependencyPropertyKey_1 = DependencyProperty.RegisterReadOnly("TrayToolTipResolved", typeof(ToolTip), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			TrayToolTipResolvedProperty = dependencyPropertyKey_1.DependencyProperty;
			dependencyPropertyKey_2 = DependencyProperty.RegisterReadOnly("CustomBalloon", typeof(Popup), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			CustomBalloonProperty = dependencyPropertyKey_2.DependencyProperty;
			IconSourceProperty = DependencyProperty.Register("IconSource", typeof(ImageSource), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null, smethod_0));
			ToolTipTextProperty = DependencyProperty.Register("ToolTipText", typeof(string), typeof(TaskbarIcon), new FrameworkPropertyMetadata(string.Empty, smethod_1));
			TrayToolTipProperty = DependencyProperty.Register("TrayToolTip", typeof(UIElement), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null, smethod_2));
			TrayPopupProperty = DependencyProperty.Register("TrayPopup", typeof(UIElement), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null, smethod_3));
			MenuActivationProperty = DependencyProperty.Register("MenuActivation", typeof(PopupActivationMode), typeof(TaskbarIcon), new FrameworkPropertyMetadata(PopupActivationMode.RightClick));
			PopupActivationProperty = DependencyProperty.Register("PopupActivation", typeof(PopupActivationMode), typeof(TaskbarIcon), new FrameworkPropertyMetadata(PopupActivationMode.LeftClick));
			DoubleClickCommandProperty = DependencyProperty.Register("DoubleClickCommand", typeof(ICommand), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			DoubleClickCommandParameterProperty = DependencyProperty.Register("DoubleClickCommandParameter", typeof(object), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			DoubleClickCommandTargetProperty = DependencyProperty.Register("DoubleClickCommandTarget", typeof(IInputElement), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			LeftClickCommandProperty = DependencyProperty.Register("LeftClickCommand", typeof(ICommand), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			LeftClickCommandParameterProperty = DependencyProperty.Register("LeftClickCommandParameter", typeof(object), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			LeftClickCommandTargetProperty = DependencyProperty.Register("LeftClickCommandTarget", typeof(IInputElement), typeof(TaskbarIcon), new FrameworkPropertyMetadata(null));
			TrayLeftMouseDownEvent = EventManager.RegisterRoutedEvent("TrayLeftMouseDown", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayRightMouseDownEvent = EventManager.RegisterRoutedEvent("TrayRightMouseDown", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayMiddleMouseDownEvent = EventManager.RegisterRoutedEvent("TrayMiddleMouseDown", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayLeftMouseUpEvent = EventManager.RegisterRoutedEvent("TrayLeftMouseUp", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayRightMouseUpEvent = EventManager.RegisterRoutedEvent("TrayRightMouseUp", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayMiddleMouseUpEvent = EventManager.RegisterRoutedEvent("TrayMiddleMouseUp", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayMouseDoubleClickEvent = EventManager.RegisterRoutedEvent("TrayMouseDoubleClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayMouseMoveEvent = EventManager.RegisterRoutedEvent("TrayMouseMove", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayBalloonTipShownEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipShown", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayBalloonTipClosedEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayBalloonTipClickedEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipClicked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayContextMenuOpenEvent = EventManager.RegisterRoutedEvent("TrayContextMenuOpen", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			PreviewTrayContextMenuOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayContextMenuOpen", RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayPopupOpenEvent = EventManager.RegisterRoutedEvent("TrayPopupOpen", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			PreviewTrayPopupOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayPopupOpen", RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayToolTipOpenEvent = EventManager.RegisterRoutedEvent("TrayToolTipOpen", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			PreviewTrayToolTipOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayToolTipOpen", RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			TrayToolTipCloseEvent = EventManager.RegisterRoutedEvent("TrayToolTipClose", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			PreviewTrayToolTipCloseEvent = EventManager.RegisterRoutedEvent("PreviewTrayToolTipClose", RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			PopupOpenedEvent = EventManager.RegisterRoutedEvent("PopupOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			ToolTipOpenedEvent = EventManager.RegisterRoutedEvent("ToolTipOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			ToolTipCloseEvent = EventManager.RegisterRoutedEvent("ToolTipClose", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			BalloonShowingEvent = EventManager.RegisterRoutedEvent("BalloonShowing", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			BalloonClosingEvent = EventManager.RegisterRoutedEvent("BalloonClosing", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon));
			ParentTaskbarIconProperty = DependencyProperty.RegisterAttached("ParentTaskbarIcon", typeof(TaskbarIcon), typeof(TaskbarIcon));
			PropertyMetadata typeMetadata = new PropertyMetadata(Visibility.Visible, smethod_4);
			UIElement.VisibilityProperty.OverrideMetadata(typeof(TaskbarIcon), typeMetadata);
			typeMetadata = new FrameworkPropertyMetadata(smethod_5);
			FrameworkElement.DataContextProperty.OverrideMetadata(typeof(TaskbarIcon), typeMetadata);
			typeMetadata = new FrameworkPropertyMetadata(smethod_6);
			FrameworkElement.ContextMenuProperty.OverrideMetadata(typeof(TaskbarIcon), typeMetadata);
		}

		[CompilerGenerated]
		private void method_26()
		{
			LeftClickCommand.smethod_7(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
		}
	}
}
